package proxymodel.impl;

import proxymodel.Treat;

/**
 * 代理类
 */
public class TreatProxy implements Treat {

    private Treat treat;//代理的目标对象

    public TreatProxy(Treat treat) {
        this.treat = treat;
    }

    public void setTreat(Treat treat) {
        this.treat = treat;
    }

    @Override
    public void treat() {
        System.out.println("我是秘书，我代老板来陪你们吃饭");
        treat.treat();
        System.out.println("这次吃的很开心，下次在谈");
    }
}
